package cn.funnyxb.powerremember.uis.wordbases.onlineImport;

import android.os.AsyncTask;
import android.os.Message;
import cn.funnyxb.powerremember.beans.WordBase;
import cn.funnyxb.tools.appFrame.App;
import cn.funnyxb.tools.appFrame.activityFrame.AbstractProccessor;
import cn.funnyxb.tools.appFrame.debugTool.Debuger;
import cn.funnyxb.tools.appFrame.util.net.NetHelper_Adv;
import cn.funnyxb.tools.appFrame.util.net.exceptions.Exception_ActiveConnectionIsNotAvailable;
import cn.funnyxb.tools.appFrame.util.net.exceptions.Exception_CannotGetConnectionSource;
import cn.funnyxb.tools.appFrame.util.net.exceptions.Exception_ResponseCodeIsNot200;
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.HashMap;
import javax.xml.parsers.FactoryConfigurationError;
import javax.xml.parsers.ParserConfigurationException;
import org.xml.sax.SAXException;

public class Proccessor_OnlineImportWordBase extends AbstractProccessor
  implements IProccessor_OnlineImportWordBase
{
  private ImportTask importTask = null;
  private AsyncTask<Void, Void, ArrayList<WordBase>> task_downloadList = null;
  private IUI_OnlineImportWordBase ui;

  public Proccessor_OnlineImportWordBase(IUI_OnlineImportWordBase paramIUI_OnlineImportWordBase)
  {
    this.ui = paramIUI_OnlineImportWordBase;
  }

  private ArrayList<WordBase> downServerList()
    throws MalformedURLException, IOException, Exception_CannotGetConnectionSource, Exception_ActiveConnectionIsNotAvailable, Exception_ResponseCodeIsNot200, ParserConfigurationException, SAXException, FactoryConfigurationError
  {
    ArrayList localArrayList1 = new ArrayList();
    String str = "http://www.5ixphone.com/pkg/" + App.getApp().getPackageName() + "/wordbases.xml";
    ArrayList localArrayList2 = new NetHelper_Adv(App.getApp()).downLv21Xml2Obj(str);
    int i = localArrayList2.size();
    if (i < 2)
      return localArrayList1;
    for (int j = 1; ; ++j)
    {
      if (j < i);
      localArrayList1.add(WordBase.parseWordBaseFromHashMap((HashMap)localArrayList2.get(j)));
    }
  }

  private void log(String paramString)
  {
    Debuger.log("proccessor_online", paramString);
  }

  public void asyncImportWordBase(WordBase paramWordBase)
  {
    log(" wordbase=" + paramWordBase + " down url=" + paramWordBase.getDownUrl());
    this.importTask = new ImportTask(this.ui, this, paramWordBase);
    this.importTask.execute(new Void[0]);
  }

  public void asyncLoadData()
  {
    Message localMessage = new Message();
    localMessage.what = 0;
    this.task_downloadList = new 1(this, localMessage);
    this.task_downloadList.execute(new Void[0]);
  }

  public void cancelDownList()
  {
    if (this.task_downloadList == null)
      return;
    this.task_downloadList.cancel(true);
  }

  public void cancelImporting()
  {
    new 2(this).execute(new Void[0]);
  }

  public void destroy()
  {
    super.releaseResource();
  }
}

/* Location:           E:\Desktop\复件 classes_dex2jar.jar
 * Qualified Name:     cn.funnyxb.powerremember.uis.wordbases.onlineImport.Proccessor_OnlineImportWordBase
 * JD-Core Version:    0.5.3
 */